how to use method reference in testing